package com.example.mvvm_base.mvvm.db;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;

import com.example.mvvm_base.userbean.UserEntity;

import java.util.List;

@Dao
public interface UserDao {
@Insert(onConflict = OnConflictStrategy.REPLACE)
    void insertUser(UserEntity.DataBean userEntity);
@Delete
    void deleteUser(UserEntity.DataBean userEntity);
@Update
    void updateUser(UserEntity.DataBean userEntity);
@Query("select * from user_info")
    List<UserEntity.DataBean> queryUser();
@Query("select * from user_info where username=:username")
    UserEntity.DataBean toUsernameQuery(String username);
}
